package abstractfactory02;


/**
 * Created by Administrator on 2017/1/8.
 */
public class ColorFactory implements Factory {
    @Override
    public Color createColor(String colorType) {
        if (colorType == null) {
            return null;
        }
        if (colorType.equalsIgnoreCase("RED")) {
            return new Red();
        } else if (colorType.equalsIgnoreCase("GREEN")) {
            return new Green();
        } else if (colorType.equalsIgnoreCase("BLUE")) {
            return new Blue();
        }
        return null;
    }

    @Override
    public Shape createShape(String shapeType) {
        return null;
    }
}

